package com.bml.architect.alibaba;

import com.alibaba.cloud.sentinel.annotation.SentinelRestTemplate;
import com.bml.architect.alibaba.handler.GlobalExceptionUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author: baiml
 * @Title: SentinelApplication
 * @ProjectName: 中台技术平台
 * @Depart 中台研发部
 * @Description:
 * @date: 2021/4/23 12:29
 */
@SpringBootApplication
@EnableFeignClients
public class SentinelApplication {

    public static void main(String[] args) {
        SpringApplication.run(SentinelApplication.class,args);
    }

    //ribbo
//    @Bean
//    @LoadBalanced
//    @SentinelRestTemplate(blockHandlerClass = GlobalExceptionUtil.class,blockHandler = "handleException"
//    ,fallbackClass = GlobalExceptionUtil.class,fallback = "fallback")
//    public RestTemplate restTemplate(){
//
//        return new RestTemplate();
//    }
}
